import {
    memberlist
} from '../../../request/api'

const state = {
    memberList: []
}
const getters = {
    getMember(state) {
        return state.memberList
    }
}
const mutations = {
    REQ_MEMBERLIST(state, payload) {
        state.memberList = payload
    }
}
const actions = {
    getMemberAction({
        commit
    }) {
        memberlist().then((res) => {
            if (res.data.code == 200) {
                let list = res.data.list ? res.data.list : []
                commit('REQ_MEMBERLIST', list)
            }
        })
    }
}
export default {
    state,
    getters,
    mutations,
    actions,
    // 开启命名空间
    namespaced: true,
}